package com.rtwo.service;

import com.rtwo.entity.Role;
import com.rtwo.repository.RoleRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.transaction.Transactional;

/**
 * Created by hasee on 2017/4/19.
 */
@Service
@Transactional
public class RoleService {

    @Resource
    private RoleRepository repository;

    public void save(Role role){
        repository.save(role);
    }

    public long getLvByName(String name){
        return repository.getLvByName(name);
    }

    public void insertName(String name,long lv){
        repository.insertName(name,lv);
    }

    public void updateName(String name,long lv){
        repository.updateName(name,lv);
    }

    public void deleteById(long id){
        repository.deleteById(id);
    }

    public String getDepById(long id){
        return repository.getDepById(id);
    }

    public long getCount(){
        return repository.count();
    }
}
